package com.example.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author readpage
 * @since 2023-02-03 16:15
 */
@TableName("comment_like")
@Schema(title = "CommentLike对象")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CommentLike implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(title = "评论点赞ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(title = "用户id")
    private Long uid;

    @Schema(title = "评论id")
    private Long commentId;

    @Schema(title = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(title = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    public String getKey() {
        return this.uid + "" + this.commentId;
    }
}